<?php

namespace App\Providers;

use App\Events\CacheCounterEvent;
use App\Events\Collect\CancelCollectEvent;
use App\Events\Collect\CreateCollectEvent;
use App\Events\CollectPackage\CreateCollectPackageEvent;
use App\Events\CollectPackage\DelCollectPackageEvent;
use App\Events\CreateCommentEvent;
use App\Events\DelCommentEvent;
use App\Events\Like\CancelLikeEvent;
use App\Events\Like\CreateLikeEvent;
use App\Events\LogCountEvent;
use App\Events\Message\ReadAnnounceEvent;
use App\Events\Reply\CreateReplyEvent;
use App\Events\Reply\DelReplyEvent;
use App\Events\UserRecommend\CancelUserRecommendEvent;
use App\Events\UserRecommend\CreateUserRecommendEvent;
use App\Listeners\CacheCounter\CacheCounterListener;
use App\Listeners\Collect\CancelCollectListener;
use App\Listeners\Collect\CreateCollectListener;
use App\Listeners\CollectPackage\CreateCollectPackageListener;
use App\Listeners\CollectPackage\DelCollectPackageListener;
use App\Listeners\Comment\CreateCommentListener;
use App\Listeners\Comment\DelCommentListener;
use App\Listeners\Like\CancelLikeListener;
use App\Listeners\Like\CreateLikeListener;
use App\Listeners\Log\LogCountListener;
use App\Listeners\Message\ReadAnnounceListener;
use App\Listeners\Reply\CreateReplyListener;
use App\Listeners\Reply\DelReplyListener;
use App\Listeners\UserRecommend\CancelUserRecommendListener;
use App\Listeners\UserRecommend\CreateUserRecommendListener;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;

class EventServiceProvider extends ServiceProvider
{
    /**
     * The event listener mappings for the application.
     *
     * @var array
     */
    protected $listen = [
        Registered::class => [
            SendEmailVerificationNotification::class,
        ],
        \Illuminate\Database\Events\QueryExecuted::class => [
            \App\Listeners\QueryListener::class,
        ],
        \App\Events\TestEvent::class => [
            \App\Listeners\TestNotification::class,
            \App\Listeners\TestCastNotification::class,
        ],

        // 缓存计数
        CacheCounterEvent::class => [
            CacheCounterListener::class
        ],

        // 统计日志
        LogCountEvent::class => [
            LogCountListener::class,
        ],

        // 评论
        CreateCommentEvent::class => [
            CreateCommentListener::class,
        ],
        DelCommentEvent::class => [
            DelCommentListener::class,
        ],

        // 回复
        CreateReplyEvent::class => [
            CreateReplyListener::class,
        ],
        DelReplyEvent::class => [
            DelReplyListener::class,
        ],

        // 点赞
        CreateLikeEvent::class => [
            CreateLikeListener::class,
        ],
        CancelLikeEvent::class => [
            CancelLikeListener::class,
        ],

        // 收藏
        CreateCollectEvent::class => [
            CreateCollectListener::class,
        ],
        CancelCollectEvent::class => [
            CancelCollectListener::class,
        ],

        // 用户推荐
        CreateUserRecommendEvent::class => [
            CreateUserRecommendListener::class,
        ],
        CancelUserRecommendEvent::class => [
            CancelUserRecommendListener::class,
        ],

        // 收藏夹
        CreateCollectPackageEvent::class => [
            CreateCollectPackageListener::class,
        ],
        DelCollectPackageEvent::class => [
            DelCollectPackageListener::class,
        ],

        // 消息
        ReadAnnounceEvent::class => [
            ReadAnnounceListener::class
        ],
    ];

    /**
     * Register any events for your application.
     *
     * @return void
     */
    public function boot()
    {
        //
    }
}
